package com.mt.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.mt.pojo.Film;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mt.pojo.FilmTag;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author Wang
 * @since 2020-11-12
 */
@Mapper
public interface FilmMapper extends BaseMapper<Film> {

    Film getFilmDetail(@Param("filmId") int filmId);

    List<Film> listRecentlyReleaseFilms(@Param("date") String date);

    List<Film> listFilmByTag(@Param("tagId") int tagId);

    List<Film> getFilmsById(@Param("ids") List<Integer> ids, @Param("date") String date);

    List<Integer> listFilmIdByTag(@Param("tagId") int tagId);

    List<Film> searchFilm(@Param("filmName") String filmName);

    List<Film> searchFilmList(IPage<Film> page,
                              @Param("tagIds") List<Integer> tagIds,
                              @Param("startTime") String startTime,
                              @Param("endTime") String endTime);

    List<Film> listAll(IPage<Film> page,@Param("date") String date);
    List<Film> getFilms(@Param("date") String date);
    List<Film> pageFilms(IPage<Film> page, @Param("filmName") String filmName);

    List<Film> listHotFilm(IPage<Film> page);

    List<FilmTag> getAllTags();

    boolean distributeTag2Film(@Param("filmId") int filmId, @Param("tagId") int tagId);
    boolean modifyTag2Film(@Param("filmId") int filmId, @Param("tagId") int tagId);

}
